package cn.wzptsoft.tinymallbe.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import java.util.Date;

@Getter
@Setter
@MappedSuperclass   // 表明为实体基类
@JsonIgnoreProperties({"handler", "hibernateLazyInitializer"})
public abstract class BaseEntity {
    /**
     * 主键：主键数据库自增
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    /**
     * 创建时间
     */
    @JsonIgnore
    private Date createTime;
    /**
     * 创建者ID
     */
    @JsonIgnore
    private Long creator;
    /**
     * 更新时间
     */
    @JsonIgnore
    private Date updateTime;
    /**
     * 更新者ID
     */
    @JsonIgnore
    private Long updater;
}
